<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>工业成品仓RFID进出库管理系统</title>
    <!--<meta name="renderer" content="webkit">-->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <script type="text/javascript" src="./static/js/framework.js"></script>
    <link rel="shortcut icon" href="./favicon.ico" mce_href="./favicon.ico" type="image/x-icon">

</head>
<body>
<div class="layui-layout layui-layout-admin" id="layui_layout">
    <!-- 顶部区域 -->
    <div class="layui-header header header-demo">
        <div class="layui-main">
            <!-- logo区域 -->
            <div class="admin-logo-box">
                <a class="logo" href="#" title="logo"><img src="static/images/logo.png"/></a>
                <div class="larry-side-menu">
                    <i class="fa fa-bars" aria-hidden="true"></i>
                </div>
            </div>
            <!-- 顶级菜单区域 -->
            <div class="layui-larry-menu">
                <!--<ul class="layui-nav clearfix">-->
                    <!--<li class="layui-nav-item layui-this">-->
                        <!--<a href="javascirpt:;"><i class="iconfont icon-wangzhanguanli"></i>内容管理</a>-->
                    <!--</li>-->
                    <!--<li class="layui-nav-item">-->
                        <!--<a href="javascirpt:;"><i class="iconfont icon-weixin3"></i>微信公众</a>-->
                    <!--</li>-->
                    <!--<li class="layui-nav-item">-->
                        <!--<a href="javascirpt:;"><i class="iconfont icon-ht_expand"></i>扩展模块</a>-->
                    <!--</li>-->
                <!--</ul>-->
            </div>


            <!-- 右侧导航 -->
            <ul class="layui-nav larry-header-item">
                <li class="layui-nav-item first">
                    <a href="javascript:;">
                        <img src="./static/images/userimg.jpg" class="userimg">
                        <cite id="login-user-span"></cite>
                        <span class="layui-nav-more"></span>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="javascript:;" onclick="resetPassword()">修改密码</a>
                        </dd>
                        <!--<dd>-->
                        <!--<a href="">菜单2</a>-->
                        <!--</dd>-->

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" id="lock">
                        <i class="iconfont icon-diannao1"></i>
                        锁屏</a>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;" id="adp-logout-bth">
                        <i class="iconfont icon-exit"></i>
                        退出</a>
                </li>
            </ul>
        </div>
    </div>
    <!-- 左侧侧边导航开始 -->
    <div class="layui-side layui-side-bg layui-larry-side" id="larry-side" style="margin-top: 5px;border-top: solid 5px #1AA094;">
        <div class="layui-side-scroll" id="larry-nav-side" lay-filter="side">

            <!-- 左侧菜单 -->
            <ul class="layui-nav layui-nav-tree">
            </ul>
        </div>
    </div>

    <!-- 左侧侧边导航结束 -->
    <!-- 右侧主体内容 -->
    <div class="layui-body" id="larry-body" style="bottom: 0;border-left: solid 2px #1AA094;margin-top: 5px;border-top: solid 5px #1AA094;">
        <div class="layui-tab layui-tab-card larry-tab-box" id="larry-tab" lay-filter="demo" lay-allowclose="true">
            <ul class="layui-tab-title">
                <li class="layui-this" id="admin-home"><i class="iconfont icon-diannao1"></i><em>后台首页</em></li>
            </ul>
            <div class="layui-tab-content" style="min-height: 150px; ">
                <div class="layui-tab-item layui-show">
                    <iframe class="larry-iframe" data-id='0' src="demo/system.jsp"></iframe>
                </div>
            </div>
        </div>


    </div>
    <!-- 底部区域 -->
    <div class="layui-footer layui-larry-foot" id="larry-footer">
        <div class="layui-mian">
            <div class="larry-footer-left">
                KCHT ADP：
                <a href="#">kcht</a>

            </div>
            <p class="p-admin">
                <span>2016 &copy;</span>
                Write by LP,<a href="http://www.tjkcht.com/tjkcht/index.html">天津科畅慧通信息技术有限公司</a>. 版权所有

            </p>
        </div>
    </div>
</div>


<script id="navitpl" type="text/html">
    {{each list}}
    <li class="layui-nav-item">
        <a href="javascript:;">
            <i class="iconfont {{$value.icon}}" ></i>
            <span>{{$value.title}}</span>
            <em class="layui-nav-more"></em>
        </a>
        <dl class="layui-nav-child">

            {{each $value.subNavigation as t index}}
            <dd>
                <a href="javascript:;" data-url="{{t.url}}">
                    <i class="iconfont {{t.icon}}" data-icon='{{t.icon}}'></i>
                    <span>{{t.title}}</span>
                </a>
            </dd>
            {{/each}}

        </dl>
    </li>
    {{/each}}
</script>

<script id="shortcutMenuTpl" type="text/html">
    <ul class="layui-nav clearfix">
        {{each list as t index}}
        <li class="layui-nav-item">
            <a href="javascript:;"  data-url="{{t.url}}" ><i data-icon="{{t.icon}}"  class="iconfont {{t.icon}}"></i>{{t.title}}</a>
        </li>
        {{/each}}

    </ul>
</script>

<script id="FORM_DEPT_TPL" type="text/html">

    <!--<div class="{{= d.rowDivClass }}" >-->
        <!--<label class="layui-form-label">{{= d.lable }}</label>-->
        <!--<div class="layui-input-inline">-->
            <!--<input style="width: 100px;" class="layui-input" type="text">-->
            <!--<a style="color:green;" href="javascript:;" id="dept">choose<i class="layui-icon">&#xe613;</i> </a>-->
        <!--</div>-->
    <!--</div>-->


    <div class="layui-form-item form-dept">
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="layui-input-inline">
            <input type="hidden" name="{{= d.name }}">
            <input type="text" name="{{= d.name }}Text" readonly  {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }} placeholder="请选择部门" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">
            <a style="color:green;" href="javascript:;" id="dept"><i class="layui-icon">&#xe613;</i> </a>
        </div>
    </div>


</script>

<script id="FORM_HIDDEN_TPL" type="text/html">
    <input type="hidden" name="{{= d.name }}" value="{{= d.value || '' }}">
</script>

<script id="FORM_UPLOADER_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}" >
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}">
            <div   {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }} >
                <div class="webuploader" param="{{=   JSON.stringify(d) }}">webuploader</div>
            </div>
        </div>
    </div>
</script>

<script id="FORM_TEXT_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}" >
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}">
            <input name="{{= d.name }}" value="" {{#  if(d.placeholder){ }} placeholder="{{= d.placeholder }}" {{#  } }}   {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }}  class="layui-input" type="text">
        </div>
    </div>
</script>


<script id="FORM_DATE_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}" >
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}"  {{#  if(d.width){ }} style="width: {{= d.width }}px;" {{#  } }} >
            <input name="{{= d.name }}"  {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }}  placeholder="{{= d.placeholder || d.format }}" autocomplete="off" class="layui-input" onclick="layui.laydate({elem: this,istime: {{= d.istime }}, format: '{{= d.format }}'})" type="text">
        </div>
    </div>
</script>

<script id="FORM_CUSTOM_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}" >
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}">
            {{ d.html }}
        </div>
    </div>
</script>


<script id="FORM_CHECKBOX_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}" >
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}" {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }}>
            {{# layui.each(d.data, function(index, item){ }}
            <input type="checkbox" name="{{= item.name }}" title="{{= item.lable }}" value="{{= item.value }}" {{#  if(item.checked){ }} checked{{#  } }}>
            {{# }); }}

        </div>
    </div>
</script>

<script id="FORM_SWITCH_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}">
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}">
            <input type="checkbox" name="{{= d.name }}" value="{{= d.value }}" lay-skin="switch" {{#  if(d.checked){ }} checked{{#  } }}>
        </div>
    </div>
</script>

<script id="FORM_RADIO_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}">
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}">
            {{# layui.each(d.data, function(index, item){ }}
            <input type="radio" name="{{= item.name }}" title="{{= item.lable }}" value="{{= item.value }}" {{#  if(item.checked){ }} checked{{#  } }}>
            {{# }); }}
        </div>
    </div>
</script>


<script id="FORM_TEXTAREA_TPL" type="text/html">
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="layui-input-block">
            <textarea name="{{= d.name }}"   {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }} {{#  if(d.placeholder){ }} placeholder="{{= d.placeholder }}" {{#  } }} class="layui-textarea"></textarea>
        </div>
    </div>
</script>


<script id="FORM_SELECT_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}">
        <label class="layui-form-label">{{= d.lable }}</label>
        <div class="{{= d.itemDivClass }}"  {{#  if(d.width){ }} style="width: {{= d.width }}px;" {{#  } }} >
            <select name="{{= d.name }}"  {{#  if(d.verify){ }} lay-verify="{{= d.verify }}" {{#  } }}>
                {{# layui.each(d.data, function(index, item){ }}
                <option value="{{= item.key }}">{{= item.value }}</option>
                {{# }); }}
            </select>
        </div>
    </div>
</script>

<script id="FORM_BUTTONS_TPL" type="text/html">
    <div class="{{= d.rowDivClass }}">
        <div {{#  if(d.layout=='vertical'){ }} class="layui-input-block" {{#  } }}>
            {{# layui.each(d.list, function(index, item){ }}
            {{#  if(item.type== 'submit'){ }}
            <button class="{{= d.btnClass }}" lay-filter="{{= d.formid }}" lay-submit data-method="{{= item.method }}">
                {{#  if(item.icon){ }} {{ d.ADP_ICON[item.icon] }} {{#  } }}
                {{= item.lable }}
            </button>
            {{#  }else{ }}

            <button class="{{= d.btnClass }}" type="{{= item.type }}"  data-method="{{= item.method }}">
                {{#  if(item.icon){ }} {{ d.ADP_ICON[item.icon] }} {{#  } }}
                {{= item.lable }}
            </button>

            {{#  } }}

            {{# }); }}
        </div>
    </div>
</script>




<!-- 锁屏 -->
<div class="lock-screen" style="display: none;">
    <div id="locker" class="lock-wrapper">
        <div id="time"></div>
        <div class="lock-box center">
            <img src="./static/images/userimg.jpg" alt="">
            <h1>重新输入密码</h1>
            <div class="form-group col-lg-12">
                <input style="margin-right: 2em;margin-left: 2em;margin-bottom: 1em;" type="password" placeholder=' 锁屏状态，请输入密码解锁' id="lock_password" class="form-control lock-input" autofocus name="lock_password">
                <br/>
                <button id="unlock" class="layui-btn btn-lock">解锁</button>
            </div>
        </div>
    </div>
</div>




<div style="display: none;" id="resetPasswordFormDiv">
    <br/>
    <form class="layui-form" action="">

        <div class="layui-form-item">
            <label class="layui-form-label">原密码</label>
            <div class="layui-input-inline">
                <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">原密码</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">新密码</label>
            <div class="layui-input-inline">
                <input type="password" name="npassword" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid layui-word-aux">新密码</div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="set_password">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>




</body>
</html>
<script type="text/javascript" src="./static/js/adp-index.js"></script>
<script>
    if(session)
        $("#login-user-span").text(session.name);
    else
        window.location.href="login.html";


    var index;
    function resetPassword() {
        index = layer.open({
            type: 1,
            content:$("#resetPasswordFormDiv")
        });
    }




    layui.use('form', function(){
        var form = layui.form();

        //监听提交
        form.on('submit(set_password)', function(data){
            var request={};
            request.password=data.field.password;
            request.npassword=data.field.npassword;
            request.name=session.name;
            $.post({
                url: "./rs/Login/resetPassword",
                data: JSON.stringify(request)


            }).error(function (data) {
                layer.msg(data.responseText);

            }).success(function (data) {
                if(data.code==0) {
                    layer.close(index);
                }else{
                    layer.msg("修改失败，原密码不正确！");
                }

            }).always(function (data) {

//                layer.close(index);

            });





            return false;
        });
    });


</script>

